package com.hgw.Demo07_ObserverPattern.JDKObserverPattern;

/**
 * Data time:2021/12/19 16:50
 * StudentID:2019112118
 * Author:hgw
 * Description: 客户端代码
 */
public class Client {
    public static void main(String[] args) {
        // 创建小偷对象
        Thief t = new Thief("隔壁老王");
        // 创建警察对象
        Policemen p = new Policemen("小李");
        // 让警察盯着小偷
        t.addObserver(p);
        // 小偷偷东西
        t.steal();
    }
}
